package com.ymatou.iapi.hunter.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.hunter.paramater.VerifyHunterUpgradeRequest;
import com.ymatou.iapi.hunter.service.VerifyHunterUpgradeCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;

/**
 * 由业务方覆盖
 * 原因：调用接口造数据困难，需要直接通过修改数据库
 */
@Ignore
public class Ts_VerifyHunterUpgrade {
	
	private static VerifyHunterUpgradeRequest verifyHunterUpgradeRequest;
	private static VerifyHunterUpgradeCall verifyHunterUpgradeCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("检查推手是否满足升级条件");
	}

	@Before
	public void caseUp() {
		verifyHunterUpgradeRequest = new VerifyHunterUpgradeRequest();
		verifyHunterUpgradeCall = new VerifyHunterUpgradeCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(verifyHunterUpgradeCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	public void verify() {
		
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_VerifyHunterUpgrade_001() {
		Logger.start(true, "检查推手");
		try {
			verifyHunterUpgradeRequest.setHunterId(1234L);
			
			verifyHunterUpgradeCall.setData(verifyHunterUpgradeRequest);
			verifyHunterUpgradeCall.callService();
			
			Logger.verifyEquals("success", verifyHunterUpgradeCall.getResponseData().getString("resultMessage"),
					"验证resultMessage");
			Logger.verifyEquals("code", verifyHunterUpgradeCall.getResponseData().getInt("resultCode"),
					"验证resultCode");
			Logger.verifyEquals(true, verifyHunterUpgradeCall.getResponseData().getBoolean("success"),
					"验证success");
			
			verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}
